// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:53 +0800 CST
// path: app/model/module/blog/blog_entity.go
// author：jon
// ==========================================================================

package blog

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id          int64     `json:"id" xorm:"not null pk autoincr comment('博客id') bigint(20)"`
	UserId      int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	Title       string    `json:"title" xorm:"comment('博客名称') varchar(255)"`
	Description string    `json:"description" xorm:"comment('博客简介') varchar(1024)"`
	Logo        string    `json:"logo" xorm:"comment('博客图片logo') varchar(255)"`
	CountNum    int64     `json:"count_num" xorm:"comment('文章数量') bigint(20)"`
	CountView   int64     `json:"count_view" xorm:"comment('阅读数量') bigint(20)"`
	CountFollow int64     `json:"count_follow" xorm:"comment('被关注数量') bigint(20)"`
	Status      int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime  time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	UserId      int64  `form:"userId" `
	Title       string `form:"title" `
	Description string `form:"description" `
	Logo        string `form:"logo" `
	CountNum    int64  `form:"countNum" `
	CountView   int64  `form:"countView" `
	CountFollow int64  `form:"countFollow" `
	Status      int    `form:"status" binding:"required"`
}

//修改页面请求参数
type EditReq struct {
	Id          int64  `form:"id" binding:"required"`
	UserId      int64  `form:"userId" `
	Title       string `form:"title" `
	Description string `form:"description" `
	Logo        string `form:"logo" `
	CountNum    int64  `form:"countNum" `
	CountView   int64  `form:"countView" `
	CountFollow int64  `form:"countFollow" `
	Status      int    `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	UserId      int64  `form:"userId"`      //用户id
	Title       string `form:"title"`       //博客名称
	Description string `form:"description"` //博客简介
	Logo        string `form:"logo"`        //博客图片logo
	CountNum    int64  `form:"countNum"`    //文章数量
	CountView   int64  `form:"countView"`   //阅读数量
	CountFollow int64  `form:"countFollow"` //被关注数量
	Status      int    `form:"status"`      //0未审核 1正常状态 2审核未通过 3删除
	BeginTime   string `form:"beginTime"`   //开始时间
	EndTime     string `form:"endTime"`     //结束时间
	PageNum     int    `form:"pageNum"`     //当前页码
	PageSize    int    `form:"pageSize"`    //每页数
}
